#!/usr/bin/env bash

# 用法 :
# ./table_diff_load.sh  table/diff/2018-05-16.sql

PREFIX=$(cd "$(dirname "$0")"; pwd)
cd $PREFIX

source config.sh
SQL=$1

cat $SQL
echo -e "\n\n------\n\n"
echo -e ">>> psql -U $PSQL_USER -d $PSQL_DB -h $PSQL_HOST -p $PSQL_PORT -f $SQL"
echo -e "\n\n------\n\n"


psql -U $PSQL_USER -d $PSQL_DB -h $PSQL_HOST -p $PSQL_PORT -f $SQL
